package com.heima.admin.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.heima.admin.service.AdminService;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 管理员用户信息表 前端控制器
 * </p>
 *
 * @author mcm
 * @since 2022-06-19
 */
@RestController
@RequestMapping("/login")
@Api(tags = "管理员用户信息表接口")
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 用户登录
     * @param dto
     * @return
     */
    @ApiOperation(value = "用户登录" ,notes = "author:lqw")
    @ApiImplicitParam(name = "dto" ,value = "登录对象" ,required = true ,dataType = "LoginDto")
    @PostMapping("/in")
    public ResponseResult login(@RequestBody LoginDto dto){
        return adminService.login(dto);
    }
}
